<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2018-03-01 13:49:35 apple $
 上传任务列表
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
if($_RQ['op']=='list'){
	$params=array('uniacid'=>$_SESSION['uniacid']);
	if($_RQ['title']){
		$params['title']=$_RQ['title'];
	}
	if($_RQ['page']){
		$params['page']=intval($_RQ['page']);
	}
	$result=cloud_request('wxapp.aliapp_up.list',$params);
	$result['htmls']=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'版本生成列表'),
			array('op'=>'list','action'=>'aliapp.list','title'=>'小程序列表'),
		),
		'search_one'=>array('name'=>'title','add'=>false),
		'list'=>array('data'=>'list','tip'=>'下载支付宝小程序，然后用支付宝小程序发布工具：IDE，上传发布小程序即可！','delall'=>false,'del_one'=>false,'edit'=>false,'list'=>array(
			array('name'=>'id','title'=>'生成任务ID','type'=>'string'),
			array('name'=>'title','title'=>'小程序名称','type'=>'string'),
			//array('name'=>'status','title'=>'上传状态','type'=>'radio','options'=>'statuss'),
			array('name'=>'remark','title'=>'备注','type'=>'string'),
			array('name'=>'createtime','title'=>'版本生成时间','type'=>'time'),
		),'action'=>array(
			array('type'=>'post','op'=>'download','title'=>'下载'),
		)),
	);
	exi($result);
}
if($_RQ['op']=='download'){
	$id=intval($_RQ['id']);
	if(!$id){
		eci('请先选择要下载的小程序！','error');
	}
	$url=cloud_request('wxapp.aliapp_up.download',array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
	exi('','','',$url);
}